package com.winsomely.leecode;

import com.winsomely.leecode.model.TreeNode;

/**
 * 二叉树的最大深度
 * 
 * @author liujiawei
 *
 */
public class MaxDepth {

	public int maxDepth(TreeNode root) {
		return root == null ? 0 : Math.max(this.maxDepth(root.left) + 1, this.maxDepth(root.right) + 1);
	}

	public static void main(String[] args) {
		MaxDepth t = new MaxDepth();
	}

}
